 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:t="http://myfaces.apache.org/tomahawk"
xmlns:ess="http://simplesurfshop.com/"
xmlns:es="http://java.sun.com/jsf/composite/ecomposite"
xmlns:c="http://java.sun.com/jsp/jstl/core">

 <ui:composition template="/template.xhtml">
  
 	<ui:define name="title">
	ShopX | Goods page
	</ui:define>
 
<ui:define name="body">  	
	<h:form id="form">
 
Sort by : <h:commandLink id="producer_name" value="Producer" actionListener="#{pagerSorter.sort}" />, 
<h:commandLink id="goods_price" value="Price" actionListener="#{pagerSorter.sort}" /> 
<br/> 
Direction:  <h:outputText value="#{pagerSorter.direction}" 
style="color:blue; font-style:italic; font-weight:bold;" />
<br/> 
<br/> 
 	
<ui:repeat value="#{dataPager.dataList}" var="goods">

	<es:goodsCell value="#{goods}" linkListener="#{redirectNavigator.processSelectedElement}" 
	linkAction="#{redirectNavigator.getFeaturesOutcome}" chooseListener="#{basketBacking.choose}" 
	confirmListener="#{basketBacking.confirm}" rejectListener="#{basketBacking.reject}"/>
		
</ui:repeat>
                
                <h:commandButton value="First" actionListener="#{pagerStepNavigator.pageFirst}"
                    disabled="#{dataPager.firstRow == 0}" />
                <h:commandButton value="Prev" actionListener="#{pagerStepNavigator.pagePrevious}"
                    disabled="#{dataPager.firstRow == 0}" />
                    
                <ui:repeat value="#{pagerNumberNavigator.pages}" var="page">
                    <h:commandLink value="#{page}" actionListener="#{pagerNumberNavigator.page}"
                        rendered="#{page != dataPager.currentPage}" />
                    <h:outputText value="#{page}" escape="false"
                        rendered="#{page == dataPager.currentPage}" />
                </ui:repeat>
                    
                <h:commandButton value="Next" actionListener="#{pagerStepNavigator.pageNext}"
                    disabled="#{dataPager.firstRow + dataPager.rowsPerPage >= dataPager.totalRows}" />
                <h:commandButton value="Last" actionListener="#{pagerStepNavigator.pageLast}"
                    disabled="#{dataPager.firstRow + dataPager.rowsPerPage >= dataPager.totalRows}" />
                <h:outputText value="  Page #{dataPager.currentPage} / #{dataPager.totalPages}" />
              	<br/>         
              	<br/>
               
                <h:outputLabel for="rowsPerPage" value="Rows per page" />
                <h:inputText id="rowsPerPage" value="#{dataPager.rowsPerPage}" size="3" maxlength="3" />
                <h:commandButton value="Set" actionListener="#{pagerNumberNavigator.renew}" />
                <h:message for="rowsPerPage" errorStyle="color: red;" />
               
              	<t:saveState value="#{pagerNumberNavigator}" />
                <t:saveState value="#{dataPager}" />
                <t:saveState value="#{pagerSorter}" />
                
 </h:form>            
 </ui:define>
</ui:composition>

 </html>